package com.briup.cms.service.impl;
/**
 * @program: Consult_Management_Syetem1
 * @description:
 * @author: 张琰
 * @create: 2020-07-02*
 **/
import com.briup.cms.bean.Privilege;
import com.briup.cms.bean.Role_privilege;
import com.briup.cms.dao.Role_privilegeMapper;

import com.briup.cms.service.IRole_privilegeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class Role_privilegeServiceImpl implements IRole_privilegeService {
    @Resource
    private Role_privilegeMapper role_privilegeMapper;
    @Override
    public List<Role_privilege> findAll() {
        return role_privilegeMapper.selectAll();
    }
    @Override
    public void saveOrUpdate(Role_privilege role_privilege) {
        if(role_privilege.getId()!=null){
            role_privilegeMapper.update(role_privilege);
        } else {
            role_privilegeMapper.insert(role_privilege);
        }
    }

    @Override
    public void deleteById(long id) {
        role_privilegeMapper.deleteById(id);
    }
}
